package cn.openea.perpartner.meily.web.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * (GroupBuyingSub)实体类
 *
 * @author rains
 * @since 2023-02-06 16:25:59
 */
@SuppressWarnings("serial")
@Data
@TableName("meily_group_buying_sub")
public class GroupBuyingSub implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId
    private String id;
    @ApiModelProperty(value = "工单号")
    private String taskNumber;
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private String createTime;
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateTime;
    @ApiModelProperty(value = "主文档ID")
    private String mainDocunid;
    @ApiModelProperty(value = "参与者id")
    private String partnerId;
    @ApiModelProperty(value = "参与者昵称")
    private String partnerName;
    @ApiModelProperty(value = "参与者头像")
    private String partnerAvatarUrl;
    @ApiModelProperty(value = "单价")
    private String unitPrice;
    @ApiModelProperty(value = "购买数量")
    private String buyQuantity;
    @ApiModelProperty(value = "支付金额")
    private String payAmount;
    @ApiModelProperty(value = "参与团购时间")
    private String joinTime;
    @ApiModelProperty(value = "商品记录唯一ID")
    private String goodsId;
    @ApiModelProperty(value = "商品编号")
    private String goodsNo;
    @ApiModelProperty(value = "商品名称")
    private String goodsName;
    @ApiModelProperty(value = "定制ID")
    private String sceneAssetsId;
    @ApiModelProperty(value = "场景ID")
    private String sceneId;
    @ApiModelProperty(value = "状态。0:未参与；1:已参与；(默认1)")
    private String status;
    @ApiModelProperty(value = "支付订单ID")
    private String orderId;
    @ApiModelProperty(value = "收货地址")
    private String address;
    @ApiModelProperty(value = "订单状态：已付款、已发货、已完成、已退款；(默认已付款)")
    private String orderStatus;
    @ApiModelProperty(value = "发货时间")
    private String deliveryTime;
    @ApiModelProperty(value = "确认收货时间")
    private String receivingTime;
    @ApiModelProperty(value = "退款订单号")
    private String refundNo;
    @ApiModelProperty(value = "退款金额")
    private String refundAmount;
    @ApiModelProperty(value = "退款时间")
    private String refundTime;
    @ApiModelProperty(value = "物流公司名称")
    private String courierName;
    @ApiModelProperty(value = "物流单号")
    private String courierNumber;
    @ApiModelProperty(value = "周期串")
    private String cycle;
    @ApiModelProperty(value = "供货商编号")
    private String supplierId;
    @ApiModelProperty(value = "供货商名称")
    private String supplierName;
    @ApiModelProperty(value = "供货商(JSONObject对象)")
    private String supplier;
    @ApiModelProperty(value = "商品规格")
    private String specification;
    @ApiModelProperty(value = "分享验证id")
    private String shareValidationId;
    @ApiModelProperty(value = "是否发放消费者分享奖励")
    private String sendShareRewards;
    @ApiModelProperty(value = "是否发放团销奖励")
    private String sendGroupSalesRewards;
    @ApiModelProperty(value = "分享图片的路径")
    private String sharePictureUrl;
    @ApiModelProperty(value = "线上服务商id")
    private String initiatorId;
    @ApiModelProperty(value = "线上服务商昵称")
    private String initiatorName;
    @ApiModelProperty(value = "标记颜色")
    private String markColor;
    @ApiModelProperty(value = "订单备注")
    private String orderRemarks;
    @ApiModelProperty(value = "是否发放线上服务商分销报酬")
    private String sendForemanReward;
    @ApiModelProperty("发货链接")
    private String shippingLink;
    @ApiModelProperty("供货价")
    private BigDecimal supplyPrice;
    @ApiModelProperty("真实供货价")
    private BigDecimal realSupplyPrice;
    @ApiModelProperty("商品品牌")
    private String goodsBrand;
    @ApiModelProperty("延迟收货时间")
    private Integer delayedReceiptDays;
    @ApiModelProperty("商品分类")
    private String goodsCategory;
    @ApiModelProperty("实物")
    private String entity;
    @ApiModelProperty(value = "商品类型")
    private String goodsType;
    @ApiModelProperty(value = "物流状态。揽收,在途,派件,签收,暂无物流")
    private String logisticsStatus;
    @ApiModelProperty(value = "评价内容")
    private String evaluationContent;
    @ApiModelProperty(value = "评价图片")
    private String evaluationPictures;
    @ApiModelProperty("原来金额")
    private BigDecimal originalPayAmount = BigDecimal.ZERO;
    @ApiModelProperty(value = "优惠券id")
    private Long couponId;
    @ApiModelProperty(value = "优惠券金额")
    private BigDecimal couponAmount = BigDecimal.ZERO;
    @ApiModelProperty(value = "是否使用抵扣。0:不使用；1:使用；(默认0)")
    private String useDeduction = "0";
    @ApiModelProperty("抵扣金额")
    private BigDecimal deductionAmount = BigDecimal.ZERO;
    @ApiModelProperty("过期时间")
    private String expirationTime;
    /**
     * {@link cn.openea.perpartner.meily.constant.enums.ExpressCompany}
     * 对应枚举
     */
    @ApiModelProperty("快递公司对应编码")
    private String expressCompanyCode;

    public boolean businessCompletion(){
        return "已完成".equals(orderStatus) || "已退款".equals(orderStatus) || "已评价".equals(orderStatus);
    }
}

